package com.example.demo.entity;
 
import lombok.Data;
 
/**
 * @Author ShenTuZhiGang
 * @Version 1.0.0
 * @Date 2020-02-10 12:51
 */
@Data
public class ResponseBean {
    private Integer status;
 
    private String msg;
 
    private Object data;
 
    public static ResponseBean build() {
        return new ResponseBean();
    }
 
    public static ResponseBean ok(String msg) {
        return new ResponseBean(200, msg, null);
    }
 
    public static ResponseBean ok(String msg, Object obj) {
        return new ResponseBean(200, msg, obj);
    }
 
    public static ResponseBean error(String msg) {
        return new ResponseBean(500, msg, null);
    }
 
    public static ResponseBean error(String msg, Object obj) {
        return new ResponseBean(500, msg, obj);
    }
 
    private ResponseBean() {
 
    }
 
    private ResponseBean(Integer status, String msg, Object obj) {
        this.status = status;
        this.msg = msg;
        this.data = obj;
    }
}